## Script (Python) "alphabetiseContext"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=Return an alphabetised list of items for the current context
##

catalog = context.portal_catalog

context_path = '/'.join(context.getPhysicalPath())

search_params = {}
search_params['path'] = {'query': context_path}
search_params['Type'] = "Space"

spaces_here = catalog.searchResults(search_params)

print "<ul class='apknSpaceNavigation'>"

for space in spaces_here:
	print "<li>"
	print "<div>"
	print "<a href='%s' title='%s'><span>%s</span></a>" \
	%(space.getURL(), space.Title, space.Title)
	
	print "</div></li>"

print "</ul>"

return printed

